

#ifndef EEPROMHELPERFUNC_H
#define EEPROMHELPERFUNC_H

namespace EEPROMHelpers{
static void writeToEeprom(unsigned char addr, unsigned long par)
{
    EEPROM.write(addr++, (char)par&255);
    EEPROM.write(addr++, (char)(par>>8)&255);
    EEPROM.write(addr++, (char)(par>>16)&255);
    EEPROM.write(addr,   (char)(par>>24)&255);
}
static unsigned long readLongFromEeprom(unsigned char addr)
{
    unsigned long retval = 0;
    retval |=  EEPROM.read(addr++);
    retval |= (EEPROM.read(addr++)>>8);
    retval |= (EEPROM.read(addr++)>>16);
    retval |= (EEPROM.read(addr  )>>24);
    return retval;
}
};

#endif // EEPROMHELPERFUNC_H
